package com.smart.system.domain.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson2.JSON;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Builder;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * 传感器数据包装类
 * 
 * @author smart
 * @date 2024
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "传感器数据包装类")
public class SensorDataWrapperDto {
    
    @Schema(description = "传感器数据")
    private SensorData sensor_data;

    /**
     * 传感器数据类
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description = "传感器数据")
    public static class SensorData {
        
        @Schema(description = "温度数据")
        private SensorValue temperature;
        
        @Schema(description = "湿度数据")
        private SensorValue humidity;
        
        @Schema(description = "硫化氢数据")
        private SensorValue sulfurH;

        @JsonProperty("Smoke")
        @Schema(description = "烟雾数据")
        private SensorValue smoke;
    }

    /**
     * 传感器值实体
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description = "传感器值")
    public static class SensorValue {
        
        @Schema(description = "传感器数值")
        private double value;
        
        @Schema(description = "单位")
        private String unit;
    }
}
